/**
 * Description: fcntl
 * File: fcntl.c |Time: 2021-04-13 14:06
 */

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char *argv[])
{
    char str[100] = {0};
    int flags = fcntl(0, F_GETFL);

    //flags = flags | O_NONBLOCK;

    //fcntl(0, F_SETFL, flags);

    while(1) {
        fgets(str, 100, stdin);
        printf("flags=%#o str: %s\n", flags, str);
        sleep(1);
    }

    return 0;
}
